require([
	"dojo/ready",
	"dojo/parser",
	"dijit/registry",
	"dojox/grid/DataGrid",
	"dojo/store/Memory",
	"dojo/data/ObjectStore",
	"dojox/grid/cells",
	"dojo/_base/array", 
	"dojo/_base/lang",
	"dojox/grid/_CheckBoxSelector",
	"dojox/grid/_RadioSelector",
	"dojo/dom"
], function(ready,parser,registry,DataGrid, Memory, ObjectStore, gridCells, baseArray, lang, _CheckBoxSelector,dom){
	ready(function(){
		var baseUrl = location.href.split("/");
		baseUrl.pop();
		baseUrl = baseUrl.join("/");
		parser.parse(document.body);
		registry.byId("baseTab").set("href", baseUrl + "/welcome.xhtml");
		
		initNotice();
		
	});
	
	function initNotice(){
		var cells = [
			[
				new gridCells.RowIndex({ width: "10%" }),
				{ name: "Column 1", field: "col1", width: "30%" },
				{ name: "Column 2", field: "col2", width: "30%" },
				{ name: "Column 3", field: "col3", width: "30%" }
			],[
				{ name: "Column 4", field: "col4", colSpan: 4 }
			]
		];
		var data = [
			{ id: 0, col1: "normal", col2: false, col3: "new", col4: "But are not followed by two hexadecimal"},
			{ id: 1, col1: "important", col2: false, col3: "new", col4: "Because a % sign always indicates"},
			{ id: 2, col1: "important", col2: true, col3: "read", col4: "Signs can be selectively"},
			{ id: 3, col1: "note", col2: false, col3: "read", col4: "However the reserved characters"},
			{ id: 4, col1: "normal", col2: false, col3: "replied", col4: "It is therefore necessary"},
			{ id: 5, col1: "important", col2: false, col3: "replied", col4: "To problems of corruption by"},
			{ id: 6, col1: "note", col2: false, col3: "replied", col4: "Which would simply be awkward in"}
		];

		var objectStore = new Memory({data:data});
		

		// global var "test_store"
		var test_store = new ObjectStore({objectStore: objectStore});

		//	create the grids.
		var grid = new DataGrid({
			store: test_store,
			structure: cells, // just the cells from the above layout
			rowSelector: true,
			"class": "grid"
		}, "grid");
		grid.startup();
	}
	
});